Skip to content

feat(nav): page registry and grouped sidebar (T-I1) - #440

Merged
lightningpixel merged 1 commit into
devfrom
feat/page-registry
Nov 13, 2026
Merged

lightningpixel merged 1 commit into
devfrom
feat/page-registry

Conversation

@lightningpixel

Copy link
Copy Markdown
Owner

Summary

The app's pages now live in one registry, src/shared/pages/pageRegistry.ts. The sidebar, the page switch, the nav store's Page type and the agent all read it: adding a page is one entry, with no edit to Sidebar.tsx or Router.tsx.

Closes #405

Registry

  • Each entry has: id, label, group, icon, load (lazy component) and wrapperClass.
  • It's a plain .ts file with icons as data ([tag, attrs]). That way the stores, the agent tools and the node tests (--experimental-strip-types, no JSX) can import it.
  • Page is derived from the registry. src/shared/router/routes.tsx is removed.

Sidebar

  • Sections in this order: Home, Create, Manage, System, with a separator between them. Groups with no page are skipped.
  • Today that gives Create (Generate, Workflows) and System (Extensions, Settings).
  • Icons, labels, order and page wrapper classes are identical to before.

Navigation

  • navigate(page, params?) opens a page on a target.
  • openExtension(id) is now navigate('models', { extension: id }). ModelsPage reads params.extension, then clears it.
  • A plain navigate(page) clears stale params.

Agent

  • The navigate tool validates the page against the registry.
  • The page list (id and label) is sent in the context and rendered as a Pages: line, instead of a fixed enum in agent.py.
  • Values are capped and kept on one line.

Test plan

  • npm run test:node: 259 tests, 258 pass, 0 fail. New tests: pageRegistry.test.ts (registry, grouping, navigate/openExtension).
  • python -m unittest tests.test_agent_client_tools: OK. The pre-push hook ran the full suite.
  • ESLint is clean. tsc reports no new errors.
  • npm run build passes, and each page is still its own chunk.
  • Manual:
    • The sidebar shows two groups with a separator, and each page opens as before.
    • From a workflow node or the Generate workflow panel, "open extension" lands on Extensions with that extension selected. Try it twice, and once from the Extensions page itself.
    • In the agent panel, "Va sur les réglages" opens Settings.

One registry (src/shared/pages/pageRegistry.ts) lists every page: id,
label, group, icon, lazy component and wrapper classes. The sidebar, the
page switch, the nav store's Page type and the agent all read it, so
adding a page is one entry.

- Sidebar sections Home, Create, Manage, System with separators; empty
  groups are skipped.
- navigate(page, params?) opens a page on a target; openExtension is
  navigate('models', { extension }). A plain navigate clears old params.
- The agent's navigate tool validates against the registry, and the page
  list reaches the backend in the context instead of a fixed enum.
@lightningpixel
lightningpixel merged commit 289c128 into dev Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant